﻿using System;

namespace Entities
{
    [Serializable]
    public class tblOrderProduct
    {
        private int order_id;
        private int product_id;
        private string name;
        private int price;
        private int quantity;
        private int total;

        public tblOrderProduct() {}

        public tblOrderProduct(int order_id, int product_id, string name, int price, int quantity, int total)
        {
            this.order_id = order_id;
            this.product_id = product_id;
            this.name = name;
            this.price = price;
            this.quantity = quantity;
            this.total = total;
        }

        public int orderID
        {
            get { return this.order_id; }
            set
            {
                this.order_id = value;
            }
        }

        public int productID
        {
            get { return this.product_id; }
            set
            {
                this.product_id = value;
            }
        }

        public string Name
        {
            get { return this.name; }
            set
            {
                this.name = value;
            }
        }

        public int Price
        {
            get { return this.price; }
            set
            {
                this.price = value;
            }
        }

        public int Quantity
        {
            get { return this.quantity; }
            set
            {
                this.quantity = value;
            }
        }

        public int Total
        {
            get { return this.total; }
            set
            {
                this.total = value;
            }
        }

        public override string ToString()
        {
            return this.order_id + "; " + this.product_id + "; " + this.name + "; " + this.price + "; " + this.quantity + "; " + this.total + "; ";
	    }
	    public override bool Equals(Object obj)
	    {
            tblOrderProduct me = (tblOrderProduct)obj;
            bool ret = this.orderID.Equals(me.orderID);
	        return ret;
	    }
	    public override int GetHashCode()
	    {
            return this.orderID.GetHashCode();
	    }

    }
}
